
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Unit.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS


FIXTURE(Unit)
{
	TEST(should be equal: )
	{
           Unit mile(MILE, 1) , yard(YARD, 1760);
	   ASSERT_EQ(true, mile == yard );
	}

        TEST(should not be equal: )
	{
           Unit mile(MILE, 1), yard(YARD, 1761);
	   ASSERT_EQ(false, mile == yard );
	}

        TEST(should be equal: )
	{
           Unit mile(MILE, 1) , feet(FEET, 1760*3);
	   ASSERT_EQ(true, (mile == feet) );
	}

        TEST(should not be equal: )
	{
           Unit mile(MILE, 1) , feet(FEET, 1761*3);
	   ASSERT_EQ(false, mile == feet );
	}
        
        TEST(mile add mile:)
        {
           Unit mile1(MILE, 3), mile2(MILE, 5), mile3(MILE,8);
           ASSERT_EQ(true,mile3 ==(mile1+ mile2));
        }
  
        TEST(mile add yard:)
        {
           Unit mile(MILE, 1), yard1(YARD, 1), yard2(YARD, 1761);
           ASSERT_EQ(true, yard2 ==(mile + yard1));
        }
  
};

